<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/jquery.min.js"></script>
    <script src="../js/jquery.easyui.min.js"></script>
    <script src="../js/easyui-lang-zh_CN.js"></script>
    <link rel="stylesheet" href="../themes/icon.css">
    <link rel="stylesheet" href="../themes/default/easyui.css">
    <link rel="stylesheet" href="../css/wu.css">
    <script>
        var  selectIndex = -1;

        function hideTable(){
            $("#searchdiv").toggle();
        }

        $(function(){
            $("#productList").datagrid({
                fit:true,
                url:'../data/products2.json',
                checkOnSelect:false,
                columns:[[
                    {field:'ck',checkbox:true},
                    {field:'code',title:'订单编号',width:100},
                    {field:'name',title:'订单日期',width:100},
                    {field:'price',title:'客户名称',width:100,
                        formatter:function(value,row,index){
                            return "￥"+row.price;
                        }
                    },
                    {field:'name1',title:'数量',width:100},
                    {field:'name2',title:'总货值',width:100},
                    {field:'name3',title:'联系人',width:100},
                    {field:'name4',title:'联系方式',width:100},
                    {field:'name5',title:'审核状态',width:100},
                    {field:'name6',title:'操作员',width:100,
                    	formatter:function(value,row,index){
                    		return "${user.userName}"
                    	}
                    },
                    {field:'opt',title:'操作',width:200,formatter:function (value,row,index) {
                            var context="<a href=\"javascript:detail('"+row.code+"')\">删除</a>&nbsp;&nbsp;" +
                                "<a href='#'>修改</a>&nbsp;&nbsp;" 
                            return context;
                        }}

                ]],
                toolbar:'#wu_toolbar',
                pagination:true ,//向后台传递参数page 和rows
                onClickRow: function(index, data) {
                    $(this).datagrid('unselectRow', index);
                }
            })
        })
        function detail(id) {
            $.messager.alert("信息","查看"+id+"产品详情");
        }
        function addProduct() {
            parent.addTabs("添加产品","goods/add_goods.html");
        }
        function del() {
            var rows=$("#productList").datagrid('getSelections');
            if(rows.length==0){
                $.messager.alert('消息',"请选择记录");
                return
            }
            $.messager.confirm('确认','您确认想要删除记录吗？',function(r){
                if (r){
                    var ids=""
                    for( var  i=0;i<rows.length;i++){
                        ids+=rows[i].code+" ";
                    }
                    $.messager.alert('消息',ids+" 删除成功！");
                }
            });

        }
    </script>

</head>
<body>
<div id="wu_toolbar">
    <div class="wu_toolbar_button">
        <a  href="#" onclick="hideTable()" class="easyui-linkbutton" data-options="iconCls:'icon-search'" plain="true">查询</a>|
        <a  href="#" onclick="addProduct()" class="easyui-linkbutton" data-options="iconCls:'icon-add'" plain="true">添加</a>|
        <a  href="#" onclick="del()" class="easyui-linkbutton" data-options="iconCls:'icon-delete-self'" plain="true">删除</a>|
        <a  href="#" onclick="reload()" class="easyui-linkbutton" data-options="iconCls:'icon-page-refresh'" plain="true">刷新</a>|
        <a  href="#" onclick="reload()" class="easyui-linkbutton" data-options="iconCls:'icon-communication'" plain="true">导出excal</a>
    </div>
    <div id="searchdiv" style="display: block;width: 100%;">
        <form name="form1" id="form1">

            <table width="100%" border="0" cellspacing="0" style="background-color:#c9dfff;" >
                <tbody><tr>
                    <td width="70"><b>检索条件:</b></td>
                    <td width="70" align="right">询价编号:</td>
                    <td width="150" align="left"><input name="findcode" class="easyui-textbox" type="text" id="findcode" value="" maxlength="100"></td>
                    <td width="70" align="right">开始日期:</td>
                    <td width="150" align="left"><div class="l-text-wrapper"><div class="l-text l-text-date"><input name="findstartDate" type="text" id="findstartDate" value="" maxlength="30" class="easyui-datebox" ligeruiid="findstartDate"><div class="l-text-l"></div><div class="l-text-r"></div><div class="l-trigger"><div class="l-trigger-icon"></div></div></div></div></td>
                    <td width="70" align="right">结束日期:</td>
                    <td width="150" align="left"><div class="l-text-wrapper"><div class="l-text l-text-date"><input name="findendDate" type="text" id="findendDate" value="" maxlength="30" class="easyui-datebox" ligeruiid="findendDate"><div class="l-text-l"></div><div class="l-text-r"></div><div class="l-trigger"><div class="l-trigger-icon"></div></div></div></div></td>
                    <td width="70" align="right">供应商名:</td>
                    <td width="150" align="left"><input name="findsupplierName" class="easyui-textbox" type="text" id="findsupplierName" value="" maxlength="100"></td>
                    <td width="72">
                        <a id="search_btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">搜索</a>
                    </td>
                    <td width="72">
                        <a id="reset_btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-refresh'">重置</a>
                    </td>
                    <td width="0"></td>


                </tr>
                </tbody>
            </table>
            <input type="hidden" id="menuCode" value="100001001">
        </form>
    </div>
</div>
<div id="productList" class="easyui-datagrid">

</div>
</body>
</html>